<?php
function SearchProduct($url)
{
    global $dbsql,$language;
    ImportClass('json');
    
    $sql_where  = " from tblproduct where iStatus=1 and cLanguage='$language' ";
    $sql_where .= " and cUrlString like '%$url%'";
    
    $sql_select = "select count(iId) as count ".$sql_where;
    $result     = $dbsql->query_fetch($sql_select);
    list($lf,$la)= Split_Page($result['count']);
    
    $sql_select = "select * ".$sql_where." order by iOrder limit $lf,$la";
    $rs         = $dbsql->query($sql_select);
    $rows       = $dbsql->num_rows($rs);
    if($rows==0)
    {
        return '<div class="notfound">'.getLang('Not Found Product').'</div>';
    }
    
    return BuildListProduct($rs);
}